/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-01-24
 * Time: 18:45
 */
public class Test {
    public void fun(int[] array){
        int left=0;
        int right=array.length-1;
        int minIndex=0;
        int maxIndex=0;
        while(left<right){
          int i=left+1;
          while(i<=right-1){
              if(array[i]<array[left]){
                  minIndex=i;
                  i++;
              }
              if(array[i]>array[right]){
                 maxIndex=i;
                  i++;
              }
              array[left]=array[minIndex];
              array[right]=array[maxIndex];
              left++;
              right--;
          }
        }
    }
    public static void main(String[] args) {

    }
}
